namespace IrisGenerator.Dal {
    using System;
    using System.Collections.Generic;
    using System.Data.SqlClient;
    using System.Configuration;
    using System.Data;
    using System.Xml;
    
    
    public partial class Metatype : IDisposable {
        
        private DataAccess _dataAccess;
        
        public Metatype() {
            this._dataAccess = new DataAccess();
        }
        
        public virtual System.Data.DataSet METATYPE_Select_All() {
            this._dataAccess.CreateProcedureCommand("sp_METATYPE_Select_All");
            DataSet value = this._dataAccess.ExecuteDataSet();
            return value;
        }
        
        public virtual System.Data.DataSet METATYPE_Select_One(System.Nullable<System.Guid> MET_ID) {
            this._dataAccess.CreateProcedureCommand("sp_METATYPE_Select_One");
            this._dataAccess.AddParameter("MET_ID", MET_ID, ParameterDirection.Input);
            DataSet value = this._dataAccess.ExecuteDataSet();
            return value;
        }
        
        public virtual System.Nullable<System.Guid> METATYPE_Insert(string MET_CODE, string MET_DESCRIPTION) {
            this._dataAccess.CreateProcedureCommand("sp_METATYPE_Insert");
            this._dataAccess.AddParameter("MET_CODE", MET_CODE, ParameterDirection.Input);
            this._dataAccess.AddParameter("MET_DESCRIPTION", MET_DESCRIPTION, ParameterDirection.Input);
            Guid value = ((Guid)(this._dataAccess.ExecuteScalar()));
            return value;
        }
        
        public virtual System.Nullable<int> METATYPE_Delete(System.Nullable<System.Guid> MET_ID) {
            this._dataAccess.CreateProcedureCommand("sp_METATYPE_Delete");
            this._dataAccess.AddParameter("MET_ID", MET_ID, ParameterDirection.Input);
            int value = this._dataAccess.ExecuteNonQuery();
            return value;
        }
        
        public virtual System.Nullable<int> METATYPE_Update(System.Nullable<System.Guid> MET_ID, string MET_CODE, string MET_DESCRIPTION) {
            this._dataAccess.CreateProcedureCommand("sp_METATYPE_Update");
            this._dataAccess.AddParameter("MET_ID", MET_ID, ParameterDirection.Input);
            this._dataAccess.AddParameter("MET_CODE", MET_CODE, ParameterDirection.Input);
            this._dataAccess.AddParameter("MET_DESCRIPTION", MET_DESCRIPTION, ParameterDirection.Input);
            int value = this._dataAccess.ExecuteNonQuery();
            return value;
        }
        
        public virtual void Dispose() {
            if ((this._dataAccess != null)) {
                this._dataAccess.Dispose();
            }
        }
    }
}
